import { createApp } from "vue";
import { createPinia } from "pinia";

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'


import "./styles/index.scss";
import "./permission";
import App from "./App.vue";
import router from "./router";
import { errorHandler } from "./error";
import "./utils/hackIpcRenderer";
import { useWebSocket } from "@vueuse/core";
// const { status, data, send, open, close } = useWebSocket(
//   "ws://127.0.0.1:8092/websocket/1",
//   {
//     autoReconnect: true,
//     heartbeat: {
//       message: JSON.stringify({ serviceType: "ping" }),
//       interval: 30000,
//       pongTimeout: 30000,
//     },
//   }
// );


const app = createApp(App);
const store = createPinia();
app.use(ElementPlus)
app.use(router);
app.use(store);

errorHandler(app);


app.mount("#app");
